home *** CD-ROM | disk | FTP | other *** search
/ Light ROM Gold / Light ROM Gold.iso / arexx / modeler / pos_rel.lwm < prev    next >
Text File  |  1993-12-25  |  1KB  |  51 lines

  1. -------------------------------begin "PosRel.lwm"----------------------
  2. /* CMD: PositionRelati
  3. ve=09=09=09=09=09=09=09=09=09=09=09=09=09*
  4.  * $VER: V1.0=09=09=09=09                                       *
  5.  * Move object to relative centerof object in bg layer,        *
  6.  *=09=09=09=09=0
  7. 9=09=09=09=09=09=09 using Bounding Box center,   */
  8. /* By Darren Reid, =A91993 Innovision Strategic Communications. */
  9.  
  10.  
  11. libadd =3D addlib("LWModelerARexx.port",0)
  12. signal on error
  13. signal on syntax
  14.  
  15. bglayer =3D CURBLAYER()
  16. fglayer =3D CURLAYER()
  17. call setlayer(bg
  18. layer)
  19. box=3Dboundingbox()  /* Should check out empty list ...  */
  20. parse var box n x1 x2 y1 y2 z1 z2
  21. cx=3D(x2+x1)/2
  22. cy=3D(y2+y1)/2
  23. cz=3D(z2+z1)/2
  24.  
  25. call setlayer(fglayer)
  26.  
  27. box=3Dboundingbox()  /* Should check out empty list ...  */
  28. parse var box n x1 x2 y1 y2 z1 z2
  29.  
  30. px=3D(x2+x1)/2
  31. py=3D(y2+y1)/2
  32. pz=3D(z2+z1)/2
  33.  
  34. dx =3D (cx - px)
  35. dy =3D (cy - py)
  36. dz =3D (cz
  37.  - pz)
  38.  
  39. call MOVE(dx dy dz)
  40.  
  41. if (libadd) then call remlib("LWModelerARexx.port")
  42. exit
  43.  
  44. syntax:
  45. error:
  46. =09t=3DNotify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  47.   if (libadd) then call 
  48. remlib("LWModelerARexx.port")
  49. =09exit
  50. ---------------------------end------------------------------------------
  51.